#include <stdlib.h>
#include <stdio.h>
#include <cmath>
+#include <QtCore/QDateTime>
+#include <QtCore/QString>
+#include <QtCore/Qdebug>
#define MYNAME "gopal"
static gbfile* fin, *fout;
static struct tm opt_tm; /* converted "date" parameter */
static
arglist_t gopal_args[] = {
- {"date", &optdate, "Complete date-free tracks with given date (YYYYMMDD).", NULL, ARGTYPE_INT, ARG_NOMINMAX },
- {"maxspeed", &optmaxspeed, "The maximum speed (km/h) traveling from waypoint to waypoint.", "200", ARGTYPE_INT, "1", "1000" },
- {"minspeed", &optminspeed, "The minimum speed (km/h) traveling from waypoint to waypoint. Set >0 to remove duplicate waypoints", "0", ARGTYPE_INT, "0", "999" },
- {"clean", &optclean, "Cleanup common errors in trackdata", "1", ARGTYPE_BOOL, ARG_NOMINMAX },
+ {"date", &optdate, "Complete date-free tracks with given date (YYYYMMDD).", NULL, ARGTYPE_INT, ARG_NOMINMAX, nullptr },
+ {"maxspeed", &optmaxspeed, "The maximum speed (km/h) traveling from waypoint to waypoint.", "200", ARGTYPE_INT, "1", "1000", nullptr },
+ {"minspeed", &optminspeed, "The minimum speed (km/h) traveling from waypoint to waypoint. Set >0 to remove duplicate waypoints", "0", ARGTYPE_INT, "0", "999", nullptr },
+ {"clean", &optclean, "Cleanup common errors in trackdata", "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
ARG_TERMINATOR
};
}
static void
-gopal_rd_deinit(void)
+gopal_rd_deinit()
{
gbfclose(fin);
}
static void
-gopal_read(void)
+gopal_read()
{
char* buff;
char tbuffer[64];
struct tm tm2;
lat_old=0;
- strftime(routename,sizeof(routename),"Tracklog %c",gmtime(&tx));
+
route = route_head_alloc();
- route->rte_name = routename;
+ QDateTime qtx;
+ qtx.setTimeSpec(Qt::UTC);
+ qtx.setTime_t(tx);
+ route->rte_name = "Tracklog ";
+ route->rte_name += qtx.toString("ddd MMM M hh:mm:ss yyyy");
+
route_add_head(route);
line=0;
}
static void
-gopal_route_hdr(const route_head* route)
+gopal_route_hdr(const route_head*)
{
}
static void
-gopal_route_tlr(const route_head* rte)
+gopal_route_tlr(const route_head*)
{
}
}
static void
-gopal_wr_deinit(void)
+gopal_wr_deinit()
{
gbfclose(fout);
}
static void
-gopal_write(void)
+gopal_write()
{
route_disp_all(gopal_route_hdr, gopal_route_tlr, gopal_write_waypt);
}
static void
-gopal_exit(void) /* optional */
+gopal_exit() /* optional */
{
}
gopal_args,
CET_CHARSET_ASCII, 0 /* ascii is the expected character set */
/* not fixed, can be changed through command line parameter */
+ , NULL_POS_OPS,
+ nullptr
};
/**************************************************************************/